<?LassoScript
/*
Tagdocs;
	{Tagname=			StripBackticks }
	{Description=		Strip backticks (`) from SQL queries }
	{Author=			Johan Sölve }
	{AuthorEmail=		johan@montania.se }
	{ModifiedBy=		 }
	{ModifiedByEmail=	 }
	{Date=				12/27/11 }
	{Usage=				(StripBackticks($SQL)) }
	{ExpectedResults=	When used on an SQL query string, backticks will be removed.
						}
	{Dependencies=		None }
	{DevelNotes=		Latest can be downloaded from http://tagSwap.net/stripbackticks }
	{ChangeNotes=		12/27/11
						First implementation.
						}
/Tagdocs;
*/

If(!(Lasso_TagExists('StripBackticks')));

	Define_Tag('StripBackticks', 
		-description = 'Removes backticks (`) from a string to make it safe for MySQL object names',
		-priority='replace',
		-required='input');
		local('output'=string(#input));
		#output = #output -> split('`') -> first;
		return(@#output);

	/Define_Tag;

	Log_Critical('Custom Tag Loaded - StripBackticks');

/If;

?>